<?php
namespace App\WsController;

use App\Logic\World\WorldLogic;
use App\Utility\Validator;
use App\Msg\MsgCode;
class World extends WsAbstract
{

    public function sendMsgToWorld()
    {
        $request = $this->request()->getArg("content");
        $message = $request['message'];
        
        $message = $request['message'];
        $this->checkViewForm(Validator::isEmpty($message), MsgCode::SEND_MSG_NULL, "", "message");
        
        (new WorldLogic())->sendMsgToWorld($this->userinfo, $message);
        $this->writeJson(MsgCode::MESSAGE_TO_WORLD_SUCCESS, [], "给世界的消息发送成功");
    }
}